clear all
set	more off

cd "~/Dropbox/ors_quality_R01"
use "data/KDG/know_do_gap.dta", clear

	
	*creating new variables for labeling purposes
	
	gen ors_pref = sp_type_cod==1
	gen anti_pref = sp_type_code==2
	gen no_pref = sp_type_code==3
	gen noincentive = sp_type_code==4
	gen supply = treatment
	
	
	label var  ors_pref "ORS Preference vs. Antibiotics Preference"
	label var  no_pref "No Preference vs. Antibiotics Preference"
	label var  anti_pref "Antibiotics Preference"
	label var  noincentive "No Financial Incentive"
	label var  supply "Given ORS supply"	

	
**************
*** Pooled ***
**************

	*extracting control mean
	sum rec_anti if treatment ==0 & sp_type==3
	local cntl_mean = r(mean)
	
	reg rec_anti ors_pref anti_pref noincentive supply, cluster(town_code)
	outreg2 using "tables/incentives_supply_anti", tex replace dec(3) ///
	nocons nor2 nonotes label ///
	ctitle("Change In Antibiotics Prescribing") ///
	keep(noincentive supply) ///
	adds(Mean in no preference/no supply group , `cntl_mean') /// 
	addtext(Controls, No) 
	
	*extracting control mean
	sum rec_anti if treatment ==0 & sp_type==3 & know_anti==1
	local cntl_mean = r(mean)
	
	reg rec_anti ors_pref anti_pref noincentive supply  if know_anti==1, cluster(town_code)
	outreg2 using "tables/incentives_supply_anti", tex dec(3) ///
	nocons nor2 nonotes label ///
	ctitle("Change In Know-Do Gap") ///
	keep(noincentive supply) ///
	adds(Mean in no preference/no supply group , `cntl_mean') /// 
	addtext(Controls, No) 

	
